---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    heritage: deckhouse
    module: deckhouse
  name: projecttypes.deckhouse.io
spec:
  group: deckhouse.io
  names:
    kind: ProjectType
    listKind: ProjectTypeList
    plural: projecttypes
    singular: projecttype
  scope: Cluster
  versions:
    - additionalPrinterColumns:
        - jsonPath: .status.ready
          name: Ready
          type: boolean
      name: v1alpha1
      schema:
        openAPIV3Schema:
          description: |
            Describes the environment template.

            This resource is referenced by the [Project](cr.html#project) CR.
          properties:
            spec:
              properties:
                namespaceMetadata:
                  x-doc-deprecated: true
                  description:
                    Labels and annotations that apply to created
                    namespaces when setting up the environment.
                  properties:
                    annotations:
                      additionalProperties:
                        type: string
                      type: object
                      x-doc-deprecated: true
                    labels:
                      additionalProperties:
                        type: string
                      type: object
                      x-doc-deprecated: true
                  type: object
                openAPI:
                  additionalProperties:
                    x-kubernetes-preserve-unknown-fields: true
                  description:
                    OpenAPI specification for template values (the [resourcesTemplate](#projecttype-v1alpha1-spec-resourcestemplate) parameter).
                  type: object
                  x-doc-deprecated: true
                resourcesTemplate:
                  description: |
                    Resource templates in `helm` format to be created when setting up a new environment.

                    Templates are fully compatible with all `helm` functions. Read more about [creating an isolated Environment](usage.html#creating-a-project)...

                    The following values are also available in templates:
                    - `{{ .projectName }}` — the name of the `Project` (environment) for which the template is being rendered.
                    - `{{ .projectTypeName }}` — the name of the `ProjectType`.
                    - `{{ .params }}` — a dictionary of custom values, described in the [.spec.openAPI](cr.html#projecttype-v1alpha1-spec-openapi) parameter and defined in the [.spec.template](cr.html#project-v1alpha1-spec-template) parameter.

                    > **Note!** Specifying `.metadata.namespace` fields for objects is optional,
                    > as they are automatically set with the name of the created environment (CR `Project`).
                  type: string
                  x-doc-deprecated: true
                subjects:
                  description:
                    List of ServiceAccounts, Groups and Users to provide
                    access to the created environment (project).
                  x-doc-deprecated: true
                  items:
                    oneOf:
                      - properties:
                          kind:
                            enum:
                              - ServiceAccount
                          name: {}
                          namespace: {}
                          role: {}
                        required:
                          - kind
                          - name
                          - namespace
                          - role
                      - properties:
                          kind:
                            enum:
                              - User
                              - Group
                          name: {}
                          role: {}
                        required:
                          - kind
                          - name
                          - role
                    properties:
                      kind:
                        description:
                          Kind of the target resource to apply access to the
                          environment (`ServiceAccount`, `Group` or `User`).
                        enum:
                          - ServiceAccount
                          - User
                          - Group
                        type: string
                        x-doc-deprecated: true
                      name:
                        description:
                          The name of the target resource to apply access
                          to the environment.
                        minLength: 1
                        type: string
                        x-doc-deprecated: true
                      namespace:
                        description:
                          The namespace of the target resource to apply environment access to.

                          Required only when using `ServiceAccount` from another namespace.
                        pattern: "[a-z0-9]([-a-z0-9]*[a-z0-9])?"
                        type: string
                        x-doc-deprecated: true
                      role:
                        description: Role name from [user-authz module](../140-user-authz/cr.html#clusterauthorizationrule-v1-spec-accesslevel)
                        enum:
                          - User
                          - PrivilegedUser
                          - Editor
                          - Admin
                        type: string
                        x-doc-deprecated: true
                    type: object
                  type: array
              type: object
            status:
              properties:
                message:
                  description: Status message.
                  type: string
                ready:
                  description: Summary of the status (ready or not ready).
                  type: boolean
              type: object
          type: object
      served: true
      storage: true
      deprecated: true
      deprecationWarning: "ProjectType is deprecated. Use ProjectTemplate instead"
      subresources:
        status: {}
